package cn.xiehangs;

//Client.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

public class Client {
    public void go(){
        try {
            Socket socket = new Socket("127.0.0.1",5000);
            InputStreamReader stream = new InputStreamReader(socket.getInputStream());
            BufferedReader reader = new BufferedReader(stream);
            String s = reader.readLine();
            System.out.println("s is "+s);
            reader.close();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static void main(String[] args){
        Client c = new Client();
        c.go();
    }
}

